<?php $pageTitle = '添加栏目';?>
<?php include 'header.tpl.php';?>
<form action="<?php echo $short_router;?>/add" method="post">
<ul>
<li>
<label for="pid">上级栏目</label>
	<select name="pid">
	<option value="0">上级栏目 </option>
	<?php foreach ($catalogList as $item):?>
	<option <?php if ($catalog['pid']==$item['id']):?>selected="selected"<?php endif;?> value="<?php echo $item['id'];?>"><?php echo str_repeat('-', $item['level']-1) . $item['name'];?></option>
	<?php endforeach;?>
	</select>
</li><li>
<label for="type">栏目类型</label>
	<?php foreach ($types as $key=>$type):?>
	<input type="radio" name="type" value="<?php echo $key;?>" <?php if ((!isset($catalog['type']) && $key=='list') || $catalog['type']==$key):?>checked="checked" <?php endif;?> /><?php echo $type;?>
	<?php endforeach;?>
</li>
<li>
<label for="name">栏目名称</label>
	<input type="text" name="name" value="<?php echo $catalog['name'];?>" />
</li><li>
<label for="priority">排序</label>
	<input type="text" name="priority" value="<?php echo isset($catalog['priority']) ? $catalog['priority'] : 100;?>" />
</li><li>
<label for="memo">栏目信息</label>
	<?php //echo Util::getFck('memo', (isset($catalog['memo']) ? $catalog['memo'] : ''));?>
	<textarea name="memo" id="memo" class="kindEditor"><?php echo isset($catalog['memo']) ? $catalog['memo'] : '';?></textarea>
</li>
<li>
<input type="hidden" name="act" value="<?php echo isset($act) ? $act : 'add';?>" />
<input type="hidden" name="cid" value="<?php echo $catalog['id'];?>" />
<button type="submit">提交</button>
<button type="reset">清空</button>
</li>
</form>

<?php include 'footer.tpl.php'?>
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
    editor = K.create('.kindEditor', {
		width: '99%',
		height: '500px',
		items: [
		        'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'cut', 'copy', 'paste',
		        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
		        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
		        'superscript', 'clearhtml', 'quickformat', 'selectall', '|',
		        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
		        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
		        'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'map', 'code', 'pagebreak',
		        'link', 'unlink', '|', 'about'
		]
    });
});
</script>
